package com.sgzn.sgpay.service.tcp.model.terminal.request;

import com.sgzn.sgpay.service.tcp.SgTcpProtocolHead;
import com.sgzn.sgpay.util.SeqUtil;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;

/**
 * Tcp 公共请求类
 * @author huangsenguang
 * @version Id: TcpCommonRequest.java, v 0.1 2018/7/16 20:04 huangsenguang Exp $$
 */
@Data
public class TcpCommonRequest implements Serializable {
    private static final long serialVersionUID = -2045490198805015868L;
    /**
     * 起始码
     */
    protected  String beginCode= SgTcpProtocolHead.TCP_PROTOCOL_HEAD;

    protected  String serialCode=SgTcpProtocolHead.TCP_SERIAL_SEND;

    /**
     * 设备ID 4字节
     */
    @NotBlank
    protected String deviceId;

    /**
     * 命令流水
     */
    @NotBlank
    protected String commandReq= SeqUtil.getSmallSeq();
    
    /**
     * 帧头
     */
    protected String head = "AA";

    /**
     * 校验
     */
    protected String check;

    /**
     * 帧尾
     */
    protected String end = "DD";

    protected String checkSumCode="sg";

    /**
     * 结束码
     */
    protected String endCode=SgTcpProtocolHead.TCP_PROTOCOL_END;
}

